Skip to content

[Apply lint] Add PR-only pre-commit workflow & lint all#169

Merged
C-Achard merged 2 commits intomainfrom
cy/apply-lint-ci
Mar 10, 2026
Merged

[Apply lint] Add PR-only pre-commit workflow & lint all#169
C-Achard merged 2 commits intomainfrom
cy/apply-lint-ci

Conversation

@C-Achard
Copy link
Collaborator

Add .github/workflows/format.yml

GitHub Actions workflow that runs pre-commit only for changed files in PRs.
It triggers on pull_request (opened, synchronize, reopened), uses a detect_changes job to checkout full history and compute the list of files changed against the base branch, and exposes that list as an output.

A precommit job (guarded by a condition that changed files exist) checks out the PR branch, sets up Python 3.12, installs pre-commit, and runs pre-commit only on the changed files.

* Refine pre-commit hook stages and ruff

Add default_stages and explicitly set stages for hooks so checks that don't modify files can run in both pre-commit and manual/CI, while modifiers run only locally. Reorganize and document ruff hooks into local autofix/write entries (runs with --fix/unsafe-fixes and format write) and CI check-only entries (output-format=github, --check/--diff). Also set stages for pyproject-fmt and validate-pyproject, add check-* hooks to pre-commit/manual, and clarify behavior with inline comments.

* [lint apply] Add PR-only pre-commit workflow

Add .github/workflows/format.yml: a GitHub Actions workflow that runs pre-commit only for changed files in PRs. It triggers on pull_request (opened, synchronize, reopened), uses a detect_changes job to checkout full history and compute the list of files changed against the base branch, and exposes that list as an output. A precommit job (guarded by a condition that changed files exist) checks out the PR branch, sets up Python 3.12, installs pre-commit, and runs pre-commit only on the changed files.

* Run pre-commit on all files

Manual fixes:
- Reordered some __init__ calls and added some __all__
- Added tensorrt import best-effort in one file
- __init__.py ignores E402 due to requiring registry update

* Update format.yml

* Use multiline GITHUB_OUTPUT for changed files

Replace the single-line echo that wrote CHANGED_FILES to $GITHUB_OUTPUT with a here-document (key<<EOF ... EOF) to correctly export multi-line file lists. This preserves newlines and spaces in the changed-files output so downstream workflow steps receive the full list.

* Update format.yml

* Fix circular import

* Fix all E501

* Export Engine for public acccess
@C-Achard C-Achard requested a review from deruyter92 March 10, 2026 10:49
@C-Achard C-Achard self-assigned this Mar 10, 2026
@C-Achard C-Achard added the CI Related to the CI / workflows label Mar 10, 2026
@C-Achard C-Achard merged commit 18913ac into main Mar 10, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Related to the CI / workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants